home *** CD-ROM | disk | FTP | other *** search
- global resultsList, currentID, GAME_ID, gBannerList, gFlashBanner, gGoodNetBanner
-
- on getNewBanner
- the actorList = []
- gBannerList = [:]
- gGoodNetBanner = 0
- member("f_reciveText").text = EMPTY
- resultsList = []
- currentID = 0
- thisURL = "http://www.kewlbox.com/ping/getBanner.cfm?gameId=" & GAME_ID
- thisObj = new(script("cfmRetreive"), thisURL, "f_reciveText", 0)
- end
-
- on newBannerType
- bannerName = getProp(gBannerList, #banneraddress)
- if bannerName <> "Default" then
- member("Other Client Ads").fileName = bannerName
- gGoodNetBanner = 1
- end if
- end
-
- on processResults thisText, thisFieldName, recordData
- oldDelims = the itemDelimiter
- the itemDelimiter = "\"
- if voidp(recordData) then
- recordData = 0
- end if
- member(thisFieldName).text = EMPTY
- if recordData then
- resultsList = []
- end if
- thisLimit = thisText.line.count
- linesAdded = 0
- repeat with index = 1 to thisLimit
- thisLine = thisText.line[index]
- if thisLine <> EMPTY then
- if recordData then
- thisTitle = thisLine.item[1]
- thisID = integer(thisLine.item[2])
- thisList = [thisTitle, thisID]
- append(resultsList, thisList)
- else
- thisTitle = thisLine
- end if
- thisTitle = Trim(thisTitle)
- if (charToNum(thisTitle.char[1]) <> 13) and (thisTitle.chars.count <> 0) then
- linesAdded = 1
- member(thisFieldName).text = member(thisFieldName).text & thisTitle & RETURN
- end if
- end if
- end repeat
- if linesAdded then
- member(thisFieldName).text = member(thisFieldName).text
- else
- member(thisFieldName).text = "Default"
- end if
- member(thisFieldName).scrollTop = 0
- the itemDelimiter = oldDelims
- l = the number of lines in the text of member "f_reciveText"
- z = 1
- repeat with i = 1 to l
- if member("f_reciveText").line[i] <> " " then
- addProp(gBannerList, getPropAt([#banneraddress: 1, #clicktolink: 2, #fileType: 3, #extra: 4], z), member("f_reciveText").line[i])
- z = z + 1
- end if
- end repeat
- newBannerType()
- end
-
- on Trim thisLine
- tempLine = thisLine
- if tempLine <> EMPTY then
- doneTrim = 0
- counter = 0
- repeat while not doneTrim
- counter = counter + 1
- thisChar = tempLine.char[counter]
- if (thisChar <> TAB) and (thisChar <> " ") then
- tempLine = tempLine.char[counter..tempLine.chars.count]
- exit repeat
- end if
- end repeat
- doneTrim = 0
- counter = tempLine.chars.count
- repeat while not doneTrim
- thisChar = tempLine.char[counter]
- if (thisChar <> TAB) and (thisChar <> " ") then
- tempLine = tempLine.char[1..counter]
- exit repeat
- end if
- counter = counter - 1
- end repeat
- end if
- return tempLine
- end
-